<script setup>
import { ref } from 'vue';

let message = ref("等待用户输入")
let content = ref("")

function keyboardEvent(event) {

    message.value = event.target.value
    content.value = message.value
}
</script>

<template>
    <div>
        <h2 id="displayText">{{ message }}</h2>
        <input type="text" id="textInput" placeholder="请输入任意文本..." v-on:input="keyboardEvent($event)"
            v-bind:value="content">
    </div>

</template>

<style scoped></style>